import Router from "vue-router"
import Vue from "vue"

Vue.use(Router)


//路由组件
const Login=()=>import('../views/Login');
const Index=()=>import('../views/Index');
const Userinfo=()=>import('../views/userInfo')

//首页
const shouye=()=>import('../views/main/shouYe/shouye');
const baoxiu=()=>import('../views/main/shouYe/baoxiu');
const test=()=>import('../views/test');

//基础信息
const eleapp=()=>import('../views/main/baseInfo/bishe/eleapp')//电器信息界面
const house=()=>import('../views/main/baseInfo/bishe/house')//房屋界面信息
const housetype=()=>import('../views/main/baseInfo/bishe/housetype')//户型信息
const room=()=>import('../views/main/baseInfo/bishe/room')//房间信息
const user=()=>import('../views/main/baseInfo/bishe/user')//业主信息

//详情页面
const HousetypeInfo=()=>import('../views/main/devicegroup/HousetypeInfo')//户型详情
const RoomInfo=()=>import('../views/main/devicegroup/RoomInfo')//户型详情


//管理员信息
const admin=()=>import('../views/main/admininfo/admin')//管理员信息管理


const router= new Router({
    routes:[
        {
            path:"/",
            redirect:"/login"
        },
        {
            path:"/login",
            name:"login",
            component:Login
        },

        {
            path:"/userinfo",
            name:"userinfo",
            component:Userinfo
        },
        {
            path:"/index",
            name:"index",
            component:Index,
            children:[
                //基础信息
                {
                    path:"baseinfo/bishe/eleapp",//电器信息
                    name:"eleapp",
                    component:eleapp
                },
                {
                    path:"baseinfo/bishe/house",//房屋信息
                    name:"house",
                    component:house
                },
                {
                    path:"baseinfo/bishe/housetype",//户型信息
                    name:"housetype",
                    component:housetype
                },
                {
                    path:"baseinfo/bishe/room",//房间信息
                    name:"room",
                    component:room
                },
                {
                    path:"baseinfo/bishe/user",//业主信息
                    name:"user",
                    component:user
                },
                //管理员信息
                {
                    path:"admininfo/admin",
                    name:"admin",
                    component:admin
                },
                //户型详情
                {
                    path:"devicegroup/HousetypeInfo",
                    name:"HousetypeInfo",
                    component:HousetypeInfo
                },
                //房间详情
                {
                    path:"devicegroup/RoomInfo",
                    name:"RoomInfo",
                    component:RoomInfo

                },
                //报修页面
                {
                    path:"shouye/baoxiu",
                    name:"baoxiu",
                    component:baoxiu

                },
                //首页
                {
                    path:"shouye/shouye",
                    name:"shouye",
                    component:shouye

                },
                //test
                {
                    path:"shouye/test",
                    name:"test",
                    component:test

                }
            ]
        },
    ]
})


export default router
